package <%= beanInfo.package %>;

package <%=beanInfo.package%>.service;

import <%= beanInfo.package %>.core.Pager;
import <%=beanInfo.package%>.entity.<%= beanInfo.classname%>;
import <%=beanInfo.package%>.dao.<%= beanInfo.classname%>Dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.apache.log4j.Logger;

import java.util.List;

/**
* Created with ruby.
* User:
* Date: <%= beanInfo.date%>
*
*/
@Component
public class <%= beanInfo.classname%>Manager {

    private static Logger logger = Logger.getLogger(<%=beanInfo.classname%>Manager.class);

    @Autowired
    private <%= beanInfo.classname%>Dao <%= beanInfo.alias%>Dao;

    public Pager findPager(<%=beanInfo.classname%>  <%=beanInfo.alias%>, Pager pager){
                    return   <%= beanInfo.alias%>Dao.findPager(<%=beanInfo.alias%>, pager);
    }
     public Pager findPagerMap(<%=beanInfo.classname%>  <%=beanInfo.alias%>, Pager pager) {
            return <%= beanInfo.alias%>Dao.findPagerMap(<%=beanInfo.alias%>, pager);
        }


    public List<<%= beanInfo.classname%>> find() {
      return <%= beanInfo.alias%>Dao.find();
      }


      public <%=beanInfo.classname%> get(Long id) {
      return <%= beanInfo.alias%>Dao.get(id);
      }

      public void save(<%=beanInfo.classname%> <%=beanInfo.alias%>) {
      <%=beanInfo.alias%>Dao.save(<%=beanInfo.alias%>);
      }

      public void update(<%=beanInfo.classname%> <%=beanInfo.alias%>) {
      <%=beanInfo.alias%>Dao.update(<%=beanInfo.alias%>);
      }

      public void deleteById(Long id) {
      <%=beanInfo.alias%>Dao.deleteById(id);
      }

       public void deleteByIds(String ids) {
              String[] arr = ids.split(",");
              if (null != arr && arr.length > 0) {
                  for(String id : arr){
                   <%=beanInfo.alias%>Dao.deleteById(Long.valueOf(id));
                  }
              }
          }
}
